/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2023-03-22
 * Time: 16:16
 */

public class Client {
    public static void main(String[] args) {
        //传统的方法
        Sheep sheep = new Sheep("tom", 1, "白色");

        //克隆
        Sheep sheep2 = new Sheep(sheep.getName(),sheep.getAge(),sheep.getColor());
        Sheep sheep3 = new Sheep(sheep.getName(),sheep.getAge(),sheep.getColor());
        Sheep sheep4 = new Sheep(sheep.getName(),sheep.getAge(),sheep.getColor());
        Sheep sheep5 = new Sheep(sheep.getName(),sheep.getAge(),sheep.getColor());
        Sheep sheep6 = new Sheep(sheep.getName(),sheep.getAge(),sheep.getColor());
        Sheep sheep7 = new Sheep(sheep.getName(),sheep.getAge(),sheep.getColor());

        //1.创建优点 是好理解 操作简单
        //2.缺点: 创建新对象时 总要从原始对象中获取属性 如果创建对象比较复杂 效率较低
        //总是需要重新初始化对象，而不是动态地获得对象运行时的状态, 不够灵活
        System.out.println(sheep);
        System.out.println(sheep2);
        System.out.println(sheep3);
        System.out.println(sheep4);

    }
}
